package com.test.design.pattern.iterator;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClasName StudentAggregateImpl
 * @Descripution TODO
 * @Author USER
 * @Date 2022/2/25 9:04
 * @Version V1.0
 */
public class StudentAggregateImpl implements  StudentAggregate{


    private List<Student> list = new ArrayList<Student>();

    public void addStudent(Student stu) {
        list.add(stu);
    }

    public void removeStudent(Student stu) {
        list.remove(stu);
    }

    public StudentIterator getStudentIterator() {
        return new StudentIteratorImpl(list);
    }

}
